<?php

/* @var $this View */

use app\components\BasePager;
use app\helpers\BookHelper;
use app\models\Book;
use yii\data\ActiveDataProvider;
use yii\web\View;

/* @var $dataProvider ActiveDataProvider */
$items = $dataProvider->getModels();

/* @var $tagList */
?>
<div class="filter">
    <div class="filter-item tile">
        <label class="tile-icon">题材：</label>
        <div class="tile-content">
            <?= BookHelper::listFilter($tagList, 't') ?>
        </div>
    </div>
    <div class="filter-item tile">
        <label class="tile-icon">进度：</label>
        <div class="tile-content">
            <?= BookHelper::listFilter(Book::$finishLabels, 'finish') ?>
        </div>
    </div>
    <div class="filter-item tile">
        <label class="tile-icon">字母：</label>
        <div class="tile-content">
            <?= BookHelper::listFilter(range('A', 'Z') + [26 => '0-9'], 'letter', FALSE) ?>
        </div>
    </div>
</div>
<?php if ($items): ?>
    <div class="columns">
        <?= $this->render('_data', ['items' => $items]); ?>
    </div>
    <?= BasePager::widget(['pagination' => $dataProvider->getPagination()]); ?>
<?php endif; ?>




